package cn.mulanbay.gateway.config;

import cn.mulanbay.api.system.factory.RemoteLogFallbackFactory;
import cn.mulanbay.api.system.factory.RemoteUserFallbackFactory;
import cn.mulanbay.business.handler.FeignCheckHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Feign
 *
 * @author fenghong
 * @create 2022-01-16 10:00
 */
@Configuration
public class FeignConfig {

    /**
     * FeignClient熔断器
     * @return
     */
    @Bean
    public RemoteUserFallbackFactory remoteUserFallbackFactory(){
        return new RemoteUserFallbackFactory();
    }

    /**
     * FeignClient熔断器
     * @return
     */
    @Bean
    public RemoteLogFallbackFactory remoteMachineFallbackFactory(){
        return new RemoteLogFallbackFactory();
    }

    /**
     * Feign验证处理
     * @return
     */
    @Bean
    public FeignCheckHandler feignCheckHandler() {
        return new FeignCheckHandler();
    }

}
